package com.neusoft.demo6;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class WindowDemo {

    public ActionListener m1() {
        return new ActionListenerImpl();
    }
    public static void main(String[] args) {
        Frame frame = new Frame("这是一个窗口");
        Button button = new Button("click me");//创建一个按钮
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("test......");
            }
        });
        frame.add(button); //将按钮添加到窗口中
        frame.setSize(400,400);
        frame.setVisible(true);
    }
}
